#ifndef __STREAM_HANDLER_H__
#define __STREAM_HANDLER_H__

#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <cstring>
#include <cstdio>
#include <ctime>
#include <cstdlib>
#include <queue>


#include "streamregisterclasses.h"
#include "wordcontainer.h"
#include "documentscontainer.h"

//TODO organizar includes en archivo
#include "./includes/file_pointer_pack.h"
#include "./includes/register_pack.h"

#include "../../block_file/src/block_file.h"
#include "../../block_file/src/block.h"
#include "../../block_file/src/block_factory.h"



namespace invertedindex{

class StreamHandler{
	private:
		StreamRegisterFactory srf;
		BlockFile bf;
	public:
		StreamHandler();
		~StreamHandler();
		bool insertDocuments(WordContainer& wc, const DocumentsContainer& dc);
		bool updateDocuments(WordContainer& wc, const DocumentsContainer& dc);
		bool searchDocuments(const WordContainer& wc, DocumentsContainer& dc);

		void toOstream(std::ostream& out);
};

}

#endif

